package cn.com.fuhuitong.main.home.mode

import cn.com.fuhuitong.http.BaseApiService
import cn.com.fuhuitong.http.BaseResponse
import cn.com.fuhuitong.main.access.entity.UserResponse
import cn.com.fuhuitong.main.home.entity.*
import io.reactivex.Observable
import retrofit2.http.*

interface HomeApi : BaseApiService {

    @GET("/api/index/index")
    fun homeIndex(): Observable<HomeResponse>

    @GET("/api/index/get_home_goods")
    fun homeGoods(
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<HomeGoodsResponse>

    /**
     * 公益慈善列表
     * */
    @GET("/api/charity/index")
    fun charityIndex(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String,
        @Query("type") type: String//1=开班信息,2=公益慈善
    ): Observable<CharityListResponse>

    /**
     *
     * */
    @GET("/api/index/get_two_home_goods")
    fun indexGetTwoHomeGoods(
        @Header("token") token: String,
        @Query("id") id: String
    ): Observable<CategoryTwoResponse>

    /**
     * 公益慈善详情
     * */
    @GET("/api/charity/detail")
    fun charityDetails(
        @Header("token") token: String,
        @Query("charity_id") charityId: String
    ): Observable<CharityDetailsResponse>

    /**
     * 公益慈善报名
     * */
    @POST("/api/charity/sign_up")
    fun charitySignUp(
        @Body signUpEntity: CharitySignUpEntity
    ): Observable<BaseResponse>

    /**
     * 改善案例列表
     * */
    @GET("/api/improved_collection/index")
    fun caseIndex(
        @Query("type") type: String,//0=全部,1=视频素材,2=图片素材
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<CaseListResponse>

    @GET("/api/improved_collection/index")
    fun caseIndex(
        @Query("home_icon_id") homeIconId: String,
        @Query("two_home_icon_id") twoHomeIconId: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<CaseListResponse>

    /**
     * 改善案例列表
     * */
    @GET("/api/massage_chair_description/index")
    fun caseChairIndex(
        @Query("type") type: String,//0=全部,1=视频素材,2=图片素材
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<CaseListResponse>

    /**
     * 会员列表
     * */
    @GET("/api/order/member_goods_list")
    fun memberList(
        @Header("token") token: String
    ): Observable<MemberResponse>

    /**
     * 获取指定会员
     * */
    @GET("/api/order/get_member")
    fun memberItem(
        @Header("token") token: String,
        @Query("id") id: String//	1=健康大使,2=家庭驿站,3=旗舰店
    ): Observable<MemberResponse>

    /**
     * 获取门店列表
     * */
    @GET("/api/flagship_store/index")
    fun flagshipIndex(
        @Query("search") search: String,
        @Query("lat") lat: String,//纬度
        @Query("lng") lng: String,//经度
        @Query("page") page: String,//纬度
        @Query("limit") limit: String//经度
    ): Observable<FlagshipListResponse>

    /**
     * 获取签到列表
     * */
    @GET("/api/sing_in/sing_in_log")
    fun signInLog(
        @Header("token") token: String
    ): Observable<SignInListResponse>


    /**
     * 用户签到
     * */
    @GET("/api/sing_in/user_sing_in")
    fun signInUser(
        @Header("token") token: String
    ): Observable<BaseResponse>

    /**
     * 快报列表
     * */
    @GET("/api/improved_collection/express_news_list")
    fun expressNewsList(
        @Query("page") page: String,//纬度
        @Query("limit") limit: String//经度
    ): Observable<BulletinListResponse>

    /**
     * 公益交流会报名
     * */
    @FormUrlEncoded
    @POST("/api/sing_in/welfare_enroll")
    fun enrollWelfare(
        @Header("token") token: String,
        @Field("name") name: String,
        @Field("sex") sex: String,
        @Field("year") year: String,
        @Field("address") address: String,
        @Field("id_num") id_num: String,
        @Field("mobile") mobile: String,
        @Field("objective") objective: String
    ): Observable<BaseResponse>

    /**
     * 申请调理报名
     * */
    @FormUrlEncoded
    @POST("/api/sing_in/conditioning_registration")
    fun enrollRecuperate(
        @Header("token") token: String,
        @Field("name") name: String,
        @Field("sex") sex: String,
        @Field("year") year: String,
        @Field("address") address: String,
        @Field("id_num") id_num: String,
        @Field("mobile") mobile: String,
        @Field("disease") disease: String,
        @Field("treatment_record") treatment_record: String,
        @Field("heard_record") heard_record: String,
        @Field("existing_symptoms") existing_symptoms: String,
        @Field("physical_condition") physical_condition: String,
        @Field("disclaimer") disclaimer: String,
        @Field("conditioning") conditioning: String
    ): Observable<BaseResponse>

    /**
     * 老人申请入驻
     * */
    @FormUrlEncoded
    @POST("/api/sing_in/the_elderly_live")
    fun enrollElderly(
        @Header("token") token: String,
        @Field("name") name: String,
        @Field("sex") sex: String,
        @Field("year") year: String,
        @Field("address") address: String,
        @Field("id_num") id_num: String,
        @Field("mobile") mobile: String
    ): Observable<BaseResponse>
}